package com.mostromas.ess.project.controller;

import com.mostromas.ess.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "软件用户WebSocket信息管理接口", description = "提供与前台用户进行交互")
//@RestController
//@RequestMapping("/websocket")
public class WebSocketController {

    @ApiOperation("WebSocket发送信息接口")
    @ApiImplicitParam(name = "id",value = "MD5",required = true)
    @GetMapping("/{id}")
    public Result sendMessage(@PathVariable("id") String id){
        WebSocketServer.sendInfo(id,"22");
        return Result.ok();
    }
}
